import matplotlib.pyplot as plt
import numpy as np


def sinh(x):
    return np.exp(x) - np.exp(-x)


def cosh(x):
    return np.exp(x) + np.exp(-x)


def tanh(x):
    return (np.exp(x) - np.exp(-x)) / (np.exp(x) + np.exp(-x))


fig = plt.figure(figsize=(6, 4))
ax = fig.add_subplot(111)
x = np.linspace(-10, 10)
y = tanh(x)
m = sinh(x)
n = cosh(x)

ax.spines['top'].set_color('none')
ax.spines['right'].set_color('none')
ax.xaxis.set_ticks_position('bottom')
ax.spines['bottom'].set_position(('data', 0))
ax.set_xticks([-10, -5, 0, 5, 10])
ax.yaxis.set_ticks_position('left')
ax.spines['left'].set_position(('data', 0))
ax.set_yticks([-10, -5, 0, 5, 10])
plt.ylim(-10, 10)
plt.plot(x, m, label="sinh", color="red")
plt.plot(x, n, label="cosh", color="green")
plt.plot(x, y, label="tanh", color="blue")
plt.legend()
plt.show()
